package tag38_02_09.threadsWeiter;

import java.util.Vector;

class Deadlock extends Thread{
	
	static Object m1 = new Object();
	static Object m2 = new Object();
	
	
	@Override
	public void run() {
		
		synchronized (m1){
			System.out.println("m1");
			synchronized (m2){
				System.out.println("m1.m2");
				
			}
		}
		
		synchronized (m2) {
			System.out.println("m2");
			synchronized (m1) {
				System.out.println("m2.m1");
			}
			
		}
		
	}
	
	
} // end of class Deadlock


public class Th17_deadlock {

	public static void main(String[] args) {

		Vector<String> v = new Vector<String>();
		v.add("Mo");
		
		new Deadlock().start();
		new Deadlock().start();
	}

}
